python objects understanding attributes and methods best practice